

getUserInfo()
async function getUserInfo() {
  const { data: { data } } = await axios.get('/user/getUserInfo')
  localStorage.setItem('user_info', JSON.stringify(data.userInfo))
  if (localStorage.getItem('user_info')) {
    const uername = JSON.parse(localStorage.getItem('user_info')).username
    $('.slinks').html(` <a data-v-697ed175="" href="#/user" class="router-link-active"><i data-v-697ed175="" class="fa fa-user"></i>&nbsp; 您好${uername}，</a>
    <a data-v-697ed175="" href="javascript:;" class="fa fa-sign-out"></a>`)
    $('.fa-sign-out').on('click', function () {
      localStorage.removeItem('udd_token')
      localStorage.removeItem('user_info')
      location.href = './index.html'
    })
  }
  const { articleNum, collectNum, zanNum, userInfo: { address, birthday, default_data, icon, id, mobile, notes, sex, username } } = data
  $('.rt h3').html(`${username} <span><b>个性宣言</b>:${notes || '未填写'}</span>`)
  if (icon !== '' && icon !== './static/images/default.png' && icon !== null) {
    $('.user-icon img').attr('src', 'http://124.223.14.236:8060/' + icon)
  } else {
    $('.user-icon img').attr('src', './static/images/default.png')
  }
  $('.rt p').html(` 性别：${sex === 0 ? '男' : '女'}<span> |</span>
                  手机号：${mobile} <span>|</span>
                  出生年月：${birthday || '未设置'}`)

  $('.fa-heart').siblings('b').html(collectNum)
  $('.fa-thumbs-up').siblings('b').html(zanNum)
  $('.fa-tasks').siblings('b').html(articleNum)
}